<template>
    <div>
        <Title :title="title"></Title>
        <div ref="right2" style="height: 150px;"></div>
    </div>
</template>
<script>
import { get } from '@/utils/request';
import { Bar } from '@antv/g2plot';

export default {
    data() {
        return {
            title: '实时颗粒物曲线',
            // 存放湿度数据
            partData: [],
        }
    },
    methods: {
        loadLine() {

            const data = [
                { year: '1951 年', value: 38 },
                { year: '1952 年', value: 52 },
                { year: '1956 年', value: 61 },
                { year: '1957 年', value: 145 },
                { year: '1958 年', value: 48 },
            ];

            const bar = new Bar(this.$refs.right2,  {
                data,
                xField: 'value',
                yField: 'year',
                seriesField: 'year',
                legend: {
                    position: 'top-left',
                },
            });

            bar.render();
        }

    },
    mounted() {
        this.loadLine()
    }

}
</script>
<style lang="less" scoped></style>